#pragma once
#include <cstdint>
#include <string>
#include <map>
#include "Singleton.h"
#include "expire_def.h"

struct Account
{
    std::uint32_t uid = 0;
	std::uint32_t agencyid = 0;
	std::string username;
};


class AccountMgr
{
public:
    AccountMgr();
    virtual ~AccountMgr() = default;

public:
    static AccountMgr* Instance()
	{
		return CSingleton<AccountMgr>::Instance();
	}

public:
    Account* GetAccount(std::uint32_t uid);
    void SetAccount(std::uint32_t uid, Account&& account);
private:
    //std::map<std::uint32_t, Account> m_accountMgr;
    
    // 用户内存数据缓存5个小时
    ExpireMgr<std::int32_t, Account, 5 * 3600> m_mgr;
};










